package com.common;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.common.mybatis.CommonIdentifierGenerator;
import com.common.mybatis.CommonSqlInjector;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CommonConfiguration {


    /**
     * 基于mybatis plus和业务封装的支持类管理启用
     */
    @Bean
    public ServiceSupportManager getServiceSupportManager() {
        return new ServiceSupportManager();
    }

    /**
     * 扩展mybatis plus 通用方法
     */
    @Bean
    public CommonSqlInjector getCommonSqlInjector() {
        return new CommonSqlInjector();
    }

    /**
     * 自定义主键生成器
     */
    @Bean
    public IdentifierGenerator getIdentifierGenerator() {
        return new CommonIdentifierGenerator();
    }

}
